*** REPLICATION TOOLKIT ***

* AUTHORS: CIMINELLI DUVAL FURCERI 

* ARTICLE: EMPLOYMENT PROTECTION DEREGULATION AND LABOR SHARES IN ADVANCED ECONOMIES 

* JOURNAL: REVIEW OF ECONOMICS AND STATISTICS

* OUTPUT: FIGURE 2, PANEL B

***************************

cd ""

global horizon 6 
global ci = 1.6

use "DTA files/Dataset country", clear

************* CLEAN DATASET ******************

xtset ifscode year

************ PREPARE VARIABLES **********

***dependent variable****
gen W = 100*ln(wsst)

* Crisis dummy
gen lny=ln(gdpv)
gen f1=lny-l.lny
gen gcrisis=0
replace gcrisis=1 if f1<-0.03

*********************Figure 2 Panel A and B***************

* Global for forward variables (Teulings and Zubanov)
global f1
global f2 f1.EPLregularworkers
global f3 f1.EPLregularworkers f2.EPLregularworkers
global f4 f1.EPLregularworkers f2.EPLregularworkers f3.EPLregularworkers
global f5 f1.EPLregularworkers f2.EPLregularworkers f3.EPLregularworkers f4.EPLregularworkers
global f6 f1.EPLregularworkers f2.EPLregularworkers f3.EPLregularworkers f4.EPLregularworkers f5.EPLregularworkers

************ ANALYSIS AND GRAPH - STRIKES **********

matrix baseline = J($horizon,4,.)

forvalues i= 1/$horizon {
xtscc  f`i'.W EPLregularworkers i.year l(0/4)gcrisis l(1/4)EPLregularworkers l(1/4)EPLtemp l(1/4).W ${f`i'}, fe lag(2)
matrix results = r(table)
matrix baseline[`i',1] = results[1,1]
matrix baseline[`i',2] = results[2,1]
matrix baseline[`i',3] = results[1,1] + $ci*results[2,1]
matrix baseline[`i',4] = results[1,1] - $ci*results[2,1]
}
capture drop coeff2 ci_p2 ci_n2
matrix coeff2 = baseline[1...,"c1"]
matrix ci_p2 = baseline[1...,"c3"]
matrix ci_n2 = baseline[1...,"c4"]
svmat coeff2
svmat ci_p2
svmat ci_n2
capture drop horizon
egen horizon = group(year) 
replace horizon = . if coeff21==.

* Create graph
graph set window fontface "Times New Roman"
graph twoway line coeff2 ci_p2 ci_n2 horizon, graphregion(color(white)) ytitle("") xtitle("") yline(0, lcolor(black)) xlabel(, nolabels) legend(off) lpattern(solid shortdash shortdash) lwidth (thick thick thick) lcolor(blue red red) ytitle("% change", height(5)) subtitle("{bf:Panel B.} Hourly wage") ysize(10) xsize(15)
graph copy B, replace
